package com.hawkstar66.practice.funny.main;

import java.util.ArrayList;
import java.util.List;

import com.hawkstar66.practice.funny.Executor;
import com.hawkstar66.practice.funny.executors.MonkeyEatPeach;
import com.hawkstar66.practice.funny.executors.bubbleSort;

public class FunnyFactory {

	public static List<Executor> executors = new ArrayList<Executor>();
	
	public static Executor getInstance(int index) {
		if(index > executors.size() || 1 > index) {
			return null ;
		}
		return executors.get(index-1);
	}
	
	public static void init() {
		executors.add(new MonkeyEatPeach());
		executors.add(new bubbleSort());
	}
}
